package com.atguigu.lease.common.exception;

import com.atguigu.lease.common.result.ResultCodeEnum;
import lombok.Data;

/**
 * projectName: com.atguigu.lease.common.exception
 *
 * @author: 顾司羽
 * time: 2024/12/11 17:23 周三
 * description:
 * todo 自定义异常 根据id删除公寓信息
 *  检查公寓是否有对应的房间
 */
@Data             // RuntimeException 里面自带message
public class LeaseException extends RuntimeException{
    private ResultCodeEnum resultCodeEnum;


    public LeaseException(String message) {
        super(message);
    }


    public LeaseException(ResultCodeEnum resultCodeEnum) {
        super(resultCodeEnum.getMessage());
        this.resultCodeEnum = resultCodeEnum;
    }
}
